package com.xxl.vueadmin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxl.vueadmin.service.ISysMenuService;
import com.xxl.vueadmin.service.ISysRoleService;
import com.xxl.vueadmin.service.ISysUserService;
import com.xxl.vueadmin.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;

/**
 * @version 1.0
 * @Author: 许啸林
 * @Date: 2021/7/28 14:20
 */
public class BaseController {
    @Autowired
    HttpServletRequest req;
    @Autowired
    RedisUtils redisUtils;
    @Autowired
    ISysUserService sysUserService;
    @Autowired
    ISysRoleService sysRoleService;
    @Autowired
    ISysMenuService sysMenuService;

    public Page getPage() {
        int current = ServletRequestUtils.getIntParameter(req, "current", 1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);

        return  new Page(current, size);
    }

}
